﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Collections;

namespace Infraestructure.CrossCutting.FTP
{
    public interface IFTPClient
    {


        #region Methods


        ArrayList Dir();
        

        ArrayList Dir(string mask);
        

        ArrayList SendCommand(string command);
        

        ArrayList XDir();
        

        ArrayList XDir(string mask, int onColumnIndex);


        void Close();


        void DeleteFile(string remoteFileName);


        void GetFile(string remoteFileName, FTPFileTransferType type);


        void GetFile(string remoteFileName, string localFileName, FTPFileTransferType type);
        
        
        void GetStream(string remoteFileName, System.IO.Stream stream, FTPFileTransferType type);
        
        
        /// <summary>
        /// Download the files of a directory
        /// </summary>
        /// <param name="remoteDirectory">directory on ftp server</param>
        /// <param name="localDirectory">directory on local server</param>
        /// <param name="type">type of file</param>
        /// <returns>the list of file succesfully download</returns>
        List<FTPFile> GetDirectory(string remoteDirectory, string localDirectory, FTPFileTransferType type);
        
        
        /// <summary>
        /// Download the files of a directory
        /// </summary>
        /// <param name="remoteDirectory">directory on ftp server</param>
        /// <param name="type">type of file</param>
        /// <returns>the list of file succesfully download</returns>
        List<FTPFile> GetDirectory(string remoteDirectory, FTPFileTransferType type);


        List<FTPFile> SendDirectory(string remoteDirectory, string localDirectory, FTPFileTransferType type);
        
        
        List<FTPFile> SendDirectory(string remoteDirectory, FTPFileTransferType type);
        
        
        bool LogMessages { get; set; }
        
        
        void MakeDir(string directoryName);
        
        
        ArrayList MessageList { get; }
        
        
        void MoveFile(string remoteFileName, string toRemotePath);
        
        
        void Open(string remoteHost, int remotePort, string user, string password);
        
        
        void Open(string remoteHost, int remotePort, string user, string password, FTPMode pMode);
        
        
        void Open(string remoteHost, string user, string password);
        
        
        void Open(string remoteHost, string user, string password, FTPMode mode);
        
        
        void RemoveDir(string directoryName);
        
        
        void RenameFile(string fromRemoteFileName, string toRemoteFileName);


        void SendFile(string localFileName, FTPFileTransferType type);
        
        
        void SendFile(string localFileName, string remoteFileName, FTPFileTransferType type);
        
        
        void SendStream(System.IO.Stream stream, string remoteFileName, FTPFileTransferType type);
        
        
        void SetCurrentDirectory(string remotePath);


        #endregion Methods

    }
}
